#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
void solve()
{
    ll n, m, sum = 0;
    ;
    cin >> n >> m;
    vector<ll> a(m + 1);
    for (auto &i : a)
    {
        cin >> i;
        sum += i;
    }
    if (sum >= n * (m-1))
    {
        cout << sum - n * (m - 1);
    }
    else
    {
        cout << 0;
    }
}
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
